package com.example.orderconsumer.service;

import com.example.orderconsumer.bean.Order;
import com.example.orderconsumer.bean.OrderRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Service
@FeignClient(
        value = "order-service",
        fallbackFactory = com.example.orderconsumer.config.OrderServiceFallbackFactory.class
)
public interface OrderService {
    @RequestMapping("/order/create")
    Integer createOrder(@RequestBody OrderRequest request);

    @RequestMapping("/order/findall")
    List<Order> findAll();
}